package com.mkirl;

import android.location.Location;

import com.google.android.maps.MyLocationOverlay;

public class Player {

	private String playerID;
	private String status;
	private String team;
	private String userClass;
	private String gameID;
	public AdvancedLocationOverlay myLocationOverlay;
	public String DEFAULT_TEAM = "Webfest A";
	public String DEFAULT_GAME = "Webfest_Game";
	
	public Player(AdvancedLocationOverlay myLocationOverlay) {
		playerID = "anonymous";
		status = "neutral";
		team = DEFAULT_TEAM;
		userClass = "none";
		gameID = DEFAULT_GAME;
		this.myLocationOverlay = myLocationOverlay;
	}
	
	public float getHeading() {
		return myLocationOverlay.getLastFix().getBearing();
	}
	
	public float getGPSAccuracy() {
		if (myLocationOverlay.getLastFix().getAccuracy() == 0) {
			return 1.0f;
		}
		else
			return myLocationOverlay.getLastFix().getAccuracy();
	}
	
	public double getLatitude() {
		double cool = myLocationOverlay.getLastFix().getLatitude();
		return cool;
	}
	
	public double getLongitude() {
		double cool = myLocationOverlay.getLastFix().getLongitude();
		return cool;
	}
	
	public Location getLocation(){
		return myLocationOverlay.getLastFix();
	}
	
	public String getPlayerID() {
		return playerID;
	}

	public void setPlayerID(String playerID) {
		this.playerID = playerID;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getTeam() {
		if (team.equals("")) {
			team = DEFAULT_TEAM;
		}
		return team;
	}

	public void setTeam(String team) {
		this.team = team;
	}

	public String getUserClass() {
		return userClass;
	}

	public void setUserClass(String userClass) {
		this.userClass = userClass;
	}

	public String getGameID() {
		return gameID;
	}

	public void setGameID(String gameID) {
		this.gameID = gameID;
	}
	
	
}
